package org.hibernate.validator;

import java.io.Serializable;

import org.hibernate.validator.Validator;


public class NotBlankValidator implements Validator<NotBlank>,  Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4707811298045083558L;

	public void initialize(NotBlank parameters) {
	}

	public boolean isValid(Object value) {
		if ( value == null ) return true;
		if ( value instanceof String ) {
			String text=(String) value;
			return !(text.trim().isEmpty());
		} else {
			return false;
		}
	}
}
